package ckw.database;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

public class OKWMember extends core.modules.database.SuperOKWMember implements
		Serializable {

	private static final long serialVersionUID = 5811764451808051670L;

	private Set<AdministratorToken> administratorTokens = new HashSet<AdministratorToken>();
	private Set<OKW> okws = new HashSet<OKW>();

	// Potrzebne dla wizardow
	private boolean checked = false;
	public void setChecked(boolean checked) {
		this.checked = checked;
	}
	public boolean getChecked() {
		return checked;
	}
	public boolean toggle() {
		checked = !checked;
		return checked;
	}

	public OKWMember() {
		super();
	}

	public OKWMember(String name, String surname, String address,
			String identificationField) {
		super(name, surname, address, identificationField);
	}

	public Set<AdministratorToken> getAdministratorTokens() {
		return administratorTokens;
	}

	public void setAdministratorTokens(
			Set<AdministratorToken> administratorTokens) {
		this.administratorTokens = administratorTokens;
	}

	public Set<OKW> getOkws() {
		return okws;
	}

	public void setOkws(Set<OKW> okws) {
		this.okws = okws;
	}

	public void addToOkws(OKW okw) {
		this.getOkws().add(okw);
		okw.getOkwMembers().add(this);
	}

	public void removeFromOkws(OKW okw) {
		this.getOkws().remove(okw);
		okw.getOkwMembers().remove(this);
	}
}
